<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>

</head>

<body>
  <div id="app">
    <ul>
      <li v-for="item in arr">
        <h3>商品名称: {{item.name}}</h3>
        <p>商品价格：{{item.price}}</p>
        <p>库存：{{item.store}}</p>
      </li>
    </ul>
    <!-- 循环嵌套循环 -->
    <div class="floor" v-for="(floor,index) in floors">
      <h2>{{floor.title}}</h2>
      <ul>
        <li v-for="(item,i) in floor.items">
          <h3>商品名称: {{item.name}}</h3>
          <p>商品价格：{{item.price}}</p>
          <p>库存：{{item.store}}</p>
        </li>
      </ul>
    </div>
  </div>
  <script src="./vue.js"></script>
  <script>
    const vm = new Vue({
      el: '#app',
      data: {
        arr: [
          {
            name: '商品1',
            price: 10,
            store: 2
          },
          {
            name: '商品2',
            price: 18.88,
            store: 5
          },
          {
            name: '商品3',
            price: 28.88,
            store: 10
          }
        ],
        floors: [
          {
            title: '分类1',
            items: [
              {
                name: '商品1',
                price: 10,
                store: 2
              },
              {
                name: '商品2',
                price: 18.88,
                store: 5
              },
              {
                name: '商品3',
                price: 28.88,
                store: 10
              }
            ]
          },
          {
            title: '分类2',
            items: [
              {
                name: '商品1',
                price: 10,
                store: 2
              },
              {
                name: '商品2',
                price: 18.88,
                store: 5
              },
              {
                name: '商品3',
                price: 28.88,
                store: 10
              }
            ]
          },
          {
            title: '分类3',
            items: [
              {
                name: '商品1',
                price: 10,
                store: 2
              },
              {
                name: '商品2',
                price: 18.88,
                store: 5
              },
              {
                name: '商品3',
                price: 28.88,
                store: 10
              }
            ]
          }
        ]
      }
    })
  </script>
</body>

</html>